<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" %>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK"%>

<%
    String path = request.getContextPath();
%>
<%
    String d = request.getParameter("d");
    if(d!=null && d.equals("1"))
    {
        response.setHeader("Content-disposition","attachment; filename=daochu.xls");
    }
//获取并判断浏览器信息
    String Agent = request.getHeader("User-Agent");
    if(Agent.contains("Chrome"))
    {
        System.out.println("Chrome");
        request.setAttribute("brtype", "cbr");
    }
    else
    {
        System.out.println("!Chrome");
        request.setAttribute("brtype", "obr");
    }
    System.out.println(Agent);
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="qtimages/css/fxke.css"/>
    <link rel="stylesheet" href="qtimages/hsgbanner.css">
    <script type="text/javascript" src="qtimages/jquery.js"></script>
    <script type="text/javascript" src="qtimages/inc.js"></script>
    <style type="text/css">
        <!--
        .STYLE2 {
            font-size: 20px;
            font-weight: bold;
            color: #078548;
        }

        -->
    </style>


    <script type="text/javascript" src="<%=path %>/js/popup.js"></script>
    <script language="JavaScript" src="<%=path %>/js/public.js" type="text/javascript"></script>
    <script type='text/javascript' src='<%=path %>/dwr/interface/loginService.js'></script>
    <script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
    <script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
    <%--<script type="text/javascript" src="<%=path %>/My97DatePicker/WdatePicker.js"></script>--%>
    <script language=javascript src='js/My97DatePicker/WdatePicker.js'></script>

    <%--1 请先登录判断--%>
    
    <script>
        <c:if test="${sessionScope.user==null}">
        javascript:alert('对不起，请您先登陆！');history.back();
        </c:if>
    </script>


    <script language="javascript">
        function check()
        {
                            if(document.getElementById("biaoti").value=="")
                {
                    alert("please input:标题");
                    return false;
                }

                if(document.getElementById("tupian").value=="")
                {
                    alert("please input:图片");
                    return false;
                }




            document.getElementById("formAdd").submit();
        }
        function up()
        {
            var pop=new Popup({ contentType:1,isReloadOnClose:false,width:400,height:200});
            pop.setContent("contentUrl","<%=path %>/upload/upload.jsp");
            pop.setContent("title","文件上传");
            pop.build();
            pop.show();
        }
        function upx(id)
        {
            //window.open("<%=path %>/upload/upload.jsp?id="+id, "_self");
            var pop=new Popup({ contentType:1,isReloadOnClose:false,width:400,height:200});
            pop.setContent("contentUrl","<%=path %>/upload/upload.jsp?id="+id);
            pop.setContent("title","文件上传");
            pop.build();
            pop.show();
        }
        function typechange()
        {
            //alert("typechange start");
            //document.formAdd.typename.value=document.formAdd.type.text;
            var obj = document.getElementById("type"); //定位id				//document.getElementById(id)
            var index = obj.selectedIndex; // 选中索引
            var text = obj.options[index].text; // 选中索引值
            //alert(index);
            //alert(text);
            //var text = obj.options[index].text; // 选中文本     输出张三等汉字信�?
            //var value = obj.options[index].value; // 选中     输出zhangsan等英文信�?
            //obj.options[index].text = obj.options[index].value;
            document.getElementById("typename").value = text; //okok
            //document.formAdd.typename.value=text; //error
            //alert("typechange end");
        }
        function init()
        {

            
            /*leibieSelect();*/

            
            /*typechange();*/
        }

        

    </script>


</head>

<body onload="init()">

<!--新头部的开始-->
<%@ include file="qttop.jsp" %>

<!--新头部的结束--> <!--产品中心ban开始-->
<%--<div class="cpzxban"></div>--%>

<!--产品中心ban结束-->

<!--主体内容的开始-->
<div class="fxmain">
    <!--顶部类别开始-->
    <div class="fx_fenlei">
        <div class="leibei fl">
            <ul>
                <li><a class="diyi">公告添加</a></li>
                <!--<li><a href="#">行业动态</a></li>
                <li><a href="#">保养常识</a></li>
                <li><a href="#">技术支持</a></li>-->
            </ul>
        </div>
        <%--<div class="dqwz fr">
            当前位置：<a href="index.jsp">网站首页</a> &gt; 用户注册
        </div>--%>
    </div>
    <!--顶部类别结束-->
    <!--详细内容的开始-->
    <div class="fxmain_nr">

        <form action="<%=path %>/gonggao?typec=gonggaoAddQian" method="post" name="formAdd"
              id="formAdd">
            <table width="98%" height="667" border="1" align="center" cellpadding="3" cellspacing="1"
                   bordercolor="#58AC22" style="border-collapse:collapse">

                						<tr>
							<td>
								标题:
						    </td>

							<td>
								<input type="text" name="biaoti" id="biaoti" size="70"/>
							</td>

						</tr>
						<tr>
							<td>
								内容:
						    </td>

							<td width="80%" bgcolor="#FFFFFF" align="left">
								<textarea name="neirong" style="width:670px;height:200px;visibility:;"></textarea>
							</td>

						</tr>
						<tr>
							<td>
								图片:
						    </td>

							<td>
								<input type="text" name="tupian" id="tupian" size="50" readonly="readonly"/>
						      <!--  <input type="button" value="上传" onclick="up()"/>  -->
						        <input type="button" value="上传" onclick="upx('tupian')"/>
						    </td>

						</tr>
						<tr>
							<td>
								时间:
						    </td>

						    <td>
						        <input type="text" name="shijian" id="shijian" size="70" value="<%=new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date())%>"/>
						    </td>

						</tr>


                <tr>
                    <td>&nbsp;</td>
                    <td colspan="2">
                        <input type="button" value="提交" onclick="check()"/>&nbsp;
                        <input type="button" value="返回" onClick="javascript:history.back()"/>

                        <%--<input type="reset" name="Submit22" value="重置"/>--%>
                    </td>
                </tr>
            </table>
        </form>

    </div>

    <!--详细内容的结束-->

</div>

<!--主体内容的结束-->


<!--底部的开始-->
<%@ include file="qtdown.jsp" %>
<!--底部的结束-->

</body>
</html>


<script language=javascript src='js/My97DatePicker/WdatePicker.js'></script>
<script type="text/javascript" src="js/popup.js"></script>
<script language=javascript src='js/ajax.js'></script>

<%@page import="java.util.ArrayList" %>
<%@page import="java.util.HashMap" %>


